package edu.unr.cater.npap.server.locator;

import com.google.web.bindery.requestfactory.shared.Locator;
import edu.unr.cater.npap.client.domain.Contact;
import org.springframework.roo.addon.gwt.RooGwtLocator;
import org.springframework.stereotype.Component;

@RooGwtLocator("edu.unr.cater.npap.client.domain.Contact")
@Component
public class ContactLocator extends Locator<Contact, Integer> {

    public Contact create(Class<? extends edu.unr.cater.npap.client.domain.Contact> clazz) {
        return new Contact();
    }

    public Contact find(Class<? extends edu.unr.cater.npap.client.domain.Contact> clazz, Integer id) {
        return Contact.findContact(id);
    }

    public Class<edu.unr.cater.npap.client.domain.Contact> getDomainType() {
        return Contact.class;
    }

    public Integer getId(Contact contact) {
        return contact.getContactId();
    }

    public Class<java.lang.Integer> getIdType() {
        return Integer.class;
    }

    public Object getVersion(Contact contact) {
        return contact.getVersion();
    }
}
